package com.example.demo.test;

import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.stereotype.Component;

@Component
public class MyBean {
    private ConfigurableListableBeanFactory beanFactory;
    public MyBean(ConfigurableListableBeanFactory beanFactory){

        this.beanFactory = beanFactory;

    }

    public Object getMyBean(String name){
        return beanFactory.getBean(name);
    }
}
